package heathot.entiy;


import java.util.ArrayList;
import java.util.List;

public class Car {
	private List<CarItem> items;
	private float total;
	
	public Car() {
		items = new ArrayList<CarItem>();
	}
	
	public float getTotal() {
		total = 0;
		for(CarItem item : items){
		total+= item.getTotalPrice();
		}
		return total;
		
	}
	public void addItem(CarItem item){
		this.items.add(item);
	}
	
	
	public List<CarItem> getItems() {
		return items;
	}
	
	public void setItems(List<CarItem> items) {
		this.items = items;
	}
	
	public void setTotal(float total) {
		this.total = total;
	}

	public Car(List<CarItem> items, float total) {
		super();
		this.items = items;
		this.total = total;
	}
	
	
}
